package com.coolw.dynamic.thread.pool.domain.request;

import com.coolw.common.api.BaseDomain;
import com.coolw.dynamic.thread.pool.enums.KeepAliveTimeUnitEnum;
import com.coolw.dynamic.thread.pool.enums.RejectedExecutionHandlerEnum;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 线程池更新请求
 *
 * @author coolw
 * @date 2024/5/15 16:30
 */
@Getter
@Setter
public class ThreadPoolConfigUpdateRequest extends BaseDomain {
    private static final long serialVersionUID = -1908350143110254982L;

    /**
     * 主键
     */
    @NotNull
    private Integer id;

    /**
     * 线程池名称
     */
    private String poolName;

    /**
     * 核心线程数
     */
    @NotNull
    private Integer corePoolSize;

    /**
     * 最大线程数
     */
    @NotNull
    private Integer maxPoolSize;

    /**
     * 线程存活时间
     */
    @NotNull
    private Long keepAliveTime;

    /**
     * 线程存活时间单位 {@link KeepAliveTimeUnitEnum}
     */
    @NotBlank
    private String keepAliveTimeUnit;

    /**
     * 拒绝策略 {@link RejectedExecutionHandlerEnum}
     */
    @NotBlank
    private String rejectStrategy;
}
